package com.kuangsheng.demo01Scanner用户交互;

import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.println("使用nextLine方法接收：");

        if(scanner.hasNext()){
            String str;
            str = scanner.nextLine();
            System.out.println("输出的内容为："+ str);
        }

        scanner.close();
    }
}
